导航菜单
首页 >  10 Free Responsive Navigation Bar in HTML CSS JavaScript  > Responsive Navigation Menu Bar in HTML CSS

Responsive Navigation Menu Bar in HTML CSS

Responsive Navigation Menu Bar in HTML CSS

Hey friends, today in this blog you’ll learn how to create a Fully Responsive Navigation Menu Bar using only HTML & CSS. In the earlier blog, I shared how to create a Responsive Sidebar Menu using HTML & CSS and now it’s time to create a navigation bar in HTML.

As you know the Menu Bar or Navigation Bar (Navbar) is important for any kind of website. Many websites have a responsive navbar or a responsive navbar with a dropdown menu. Essentially, responsive design is a way to put together a website so that it automatically scales its content and elements to match the screen size on which it is viewed. It keeps images from being larger than the screen width and prevents visitors from mobile devices from needing to do extra work to read your content.

In our design (Responsive Navigation Bar), as you can see in the preview image, there is a horizontal navigation bar or navbar with a logo on the left side and some navigation links on the right side. This is a very simple navigation bar and it is created using only HTML & CSS.

The best part about this navigation bar is, that it is fully responsive for any kind of device including mobile phones. On the pc, this navigation bar is displayed in a horizontal line but on mobile devices, this navbar or navigation bar is displayed in a vertical line. On the mobile, you have the option to show or hide the menu bar by clicking on the hamburger menu icon.

Video tutorial of Responsive Navigation Menu Bar

In the video tutorial, you have seen this is a pure CSS responsive navigation bar and I’ve used CSS @media property to make this navigation bar fully responsive for mobile devices. If you like this responsive navigation bar and want to get source codes of this program then you can easily copy the codes of this tutorial from the given copy boxes or you can also download the code files of this navigation menu bar.

If you’re a beginner and you know a little bit of HTML & CSS then the codes and concept of this responsive navigation menu bar will definitely help you to understand HTML & CSS more. This is a very simple responsive navigation bar with few and clean codes.

You might like this:Top 10 Trendy Navigation MenuSidebar Menu using HTML & CSSResponsive Navbar with Search BoxDrop-Down Menu Bar using HTML CSSResponsive Navigation Menu Bar [Source Codes]

To create this responsive navigation bar. First, you need to create two Files one HTML File and another one is CSS File. After creating these files just paste the following codes into your file. You can also download the source code files of this responsive navigation menu bar from the below download button.

First, create an HTML file with the name index.html and paste the given codes in your HTML file. Remember, you’ve to create a file with .html extension.

Responsive Navbar CodingNepal Home About Services Contact Feedback

Second, create a CSS file with the name style.css and paste the given codes in your CSS file. Remember, you’ve to create a file with .css extension.

/* Google Fonts Link */@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');* { padding: 0; margin: 0; text-decoration: none; list-style: none; box-sizing: border-box;}body { font-family: "Montserrat", sans-serif;}nav { background: #0082e6; height: 80px; width: 100%;}label.logo { color: white; font-size: 25px; line-height: 80px; padding: 0 100px; font-weight: bold;}nav ul { float: right; margin-right: 20px;}nav ul li { display: inline-block; line-height: 80px; margin: 0 5px;}nav ul li a { color: white; font-size: 17px; padding: 7px 13px; border-radius: 3px; text-transform: uppercase;}a.active,a:hover { background: #1b9bff; transition: .5s;}.checkbtn { font-size: 22px; color: white; float: right; line-height: 80px; margin-right: 30px; cursor: pointer; display: none;}#check { display: none;}@media (max-width: 1050px) { label.logo {padding-left: 30px; } nav ul li a {font-size: 16px; }}/* Responsive media query code for small screen */@media (max-width: 890px) { .checkbtn {display: block; } label.logo {font-size: 22px; } ul {position: fixed;width: 100%;height: 100vh;background: #2c3e50;top: 80px;left: -100%;text-align: center;transition: all .5s; } nav ul li {display: block;margin: 50px 0;line-height: 30px; } nav ul li a {font-size: 20px; } a:hover, a.active {background: none;color: #0082e6; } #check:checked~ul {left: 0; }}section { background: url("bg.jpg") no-repeat; background-size: cover; height: calc(100vh - 80px);}

That’s all, now you’ve successfully created a Responsive Navigation Menu Bar using HTML & CSS. If your code doesn’t work or you’ve faced any errors/problems then please download the source code files from the given download button. It’s free and a .zip file will be downloaded then you’ve to extract it.

 

相关推荐: